package svc.elib.analysis;

import java.io.IOException;

import svc.elib.db.Database;
import svc.elib.socnet.EvolutionarySnapshots;
import svc.elib.socnet.Net;
import svc.elib.socnet.SocConstructor;

public class GrowthRate {

	public static void main(String[] args) 
		throws IOException
	{
		Database db = new Database("eLibData.csv", 1932, 2011);
		System.out.println(db.info());
		SocConstructor soc = new SocConstructor(db);
		Net net = soc.getNet();
	
		EvolutionarySnapshots es = new EvolutionarySnapshots(net);
		int startYear = es.getStartYear();
		Net[] snaps = es.getSnapshots();
		
		for (int i = 0; i < snaps.length; i++) {
			Net cSnap = snaps[i];
			int year = startYear + i;
		
			if (year % 10 == 1) {
				int nodes = cSnap.getNumNodes();
				int links  = cSnap.getNumLinks();
				int isolated = cSnap.getNumIsolated();
				
				System.out.println(year + ", " + nodes + ", " + links + ", " + isolated);
			}
		}
		
		
	}
}
